-
-
Notifications
You must be signed in to change notification settings - Fork 40
Implemented platform-specific templateUrl #155
Implemented platform-specific templateUrl #155
Conversation
Can you extract the common logic from the two loaders? |
Hi @sis0k0, yes.. I can take one of these approaches, do you have a perference?
I think the latter is less code and has better performance as it only needs to traverse the entire tree once. |
I would suggest refactoring it into a single plugin which has two options obj: { resolveStylesUrls: boolean, resolveTemplateUrls: boolean }. If you have any problems, ping me in the community slack :) |
A downside of not merging the PR as is, is that it will break backward compatibility as folks now have |
We can deprecate it and even remove it from the webpack config on postinstall. |
… opt out of (the default) platform replacement strategy.
Hi @sis0k0, I've just pushed a change to bring all this code back to 1 file, and offer the option to opt out of replacing either css or html files. |
Looks good :). I'll add postinstall step to replace the old plugin in the user's webpack config. |
Eddy, check out EddyVerbruggen#1 :) |
feat: postinstall replaces StyleUrlResolvePlugin with UrlResolvePlugin
Post install script works great ✅ |
Hi,
I was trying to webpack my Angular app which has a few components with the structure as shown in this screenshot:
So there's no
article-item.html
, but there arearticle-item.ios.html
andarticle-item.android.html
.As you may know using
<ios></ios><android></android>
inarticle-item.html
does not work (reliably) in Angular apps so using that workaround (mentioned in #75) doesn't help me out.So I copy-pasted the css file resolver (which works great!) and applied that to the view files. Now the approach in the screenshot works for non-webpack and webpack NativeScript-Angular projects.
Thanks for considering,
Eddy